Skip to content

Conversation

@roblabla
Copy link
Member

@roblabla roblabla commented Aug 20, 2019

Implement NPDM support.

Closes #4

@todo
Copy link

todo bot commented Aug 20, 2019

Optionally pass a (signed) ACID here.

linkle/src/format/npdm.rs

Lines 180 to 190 in 68e9fe5

// TODO: Optionally pass a (signed) ACID here.
pub fn into_npdm<W: Write>(&self, mut file: W, _signed: bool) -> Result<(), Error> {
let mut meta: RawMeta = RawMeta::default();
meta.magic = *b"META";
if self.address_space_type & !3 != 0 {
return Err(Error::InvalidNpdmValue("address_space_type".into(), Backtrace::new()));
}
meta.mmu_flags = (self.address_space_type & 3) << 1;
if self.is_64_bit { meta.mmu_flags |= 1; }


This comment was generated by todo based on a TODO comment in 68e9fe5 in #39. cc @MegatonHammer.

@todo
Copy link

todo bot commented Aug 20, 2019

Unqualified approval. Zefuk is this?

linkle/src/format/npdm.rs

Lines 234 to 244 in 68e9fe5

// TODO: Unqualified approval. Zefuk is this?
acid.titleid_range_min = self.title_id_range_min.0;
acid.titleid_range_max = self.title_id_range_max.0;
acid.fs_access_control_offset = meta.acid_offset + size_of::<RawAcid>() as u32;
acid.fs_access_control_size = size_of::<RawFileSystemAccessControl>() as u32;
acid.service_access_control_offset = acid.fs_access_control_offset + acid.fs_access_control_size;
acid.service_access_control_size = (sac_encoded_len(&self.service_host) + sac_encoded_len(&self.service_access)) as u32;


This comment was generated by todo based on a TODO comment in 68e9fe5 in #39. cc @MegatonHammer.

@todo
Copy link

todo bot commented Aug 20, 2019

there's more optional stuff afterwards.

linkle/src/format/npdm.rs

Lines 346 to 356 in 68e9fe5

// TODO: there's more optional stuff afterwards.
}
#[repr(C)]
#[derive(Default, Clone, Copy, Serialize)]
struct RawMeta {
magic: [u8; 4],
#[doc(hidden)]
reserved4: u32,
reserved8: u32,
mmu_flags: u8,


This comment was generated by todo based on a TODO comment in 68e9fe5 in #39. cc @MegatonHammer.

@todo
Copy link

todo bot commented Sep 1, 2019

Pretty errors if the user messes up.

// TODO: Pretty errors if the user messes up.
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum Syscalls {
/// Accepts the standard svcName: 0xsvc_hex
KeyValue(HashMap<String, HexOrNum>),
/// Accepts syscall names. Those must be correctly spelled.
Name(Vec<syscalls::SyscallNames>),
}
#[derive(Serialize, Deserialize, Debug)]


This comment was generated by todo based on a TODO comment in fd7af29 in #39. cc @MegatonHammer.

@todo
Copy link

todo bot commented Sep 1, 2019

there's more optional stuff afterwards.

linkle/src/format/npdm.rs

Lines 464 to 474 in fd7af29

// TODO: there's more optional stuff afterwards.
}
#[repr(C)]
#[derive(Default, Clone, Copy, Serialize)]
struct RawMeta {
magic: [u8; 4],
#[doc(hidden)]
reserved4: u32,
reserved8: u32,
mmu_flags: u8,


This comment was generated by todo based on a TODO comment in fd7af29 in #39. cc @MegatonHammer.

@todo
Copy link

todo bot commented Apr 7, 2020

there's more optional stuff afterwards.

linkle/src/format/npdm.rs

Lines 464 to 474 in 9d0a9dc

// TODO: there's more optional stuff afterwards.
}
#[repr(C)]
#[derive(Default, Clone, Copy, Serialize)]
struct RawMeta {
magic: [u8; 4],
#[doc(hidden)]
reserved4: u32,
reserved8: u32,
mmu_flags: u8,


This comment was generated by todo based on a TODO comment in 9d0a9dc in #39. cc @MegatonHammer.

@roblabla
Copy link
Member Author

Blocked on RustCrypto/RSA#43

@marysaka
Copy link
Member

Not blocked anymore, need a rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add NPDM format support

3 participants